package file;

import java.io.File;
import java.io.IOException;

// 文件的删除
public class Demo3 {
    public static void main(String[] args) throws IOException, InterruptedException {
        File file = new File("helloworld.txt");

        //file.delete();
        //file.createNewFile();
        // 程序退出之后再删除
        file.deleteOnExit();
        Thread.sleep(5000);
        System.out.println(file.exists());
    }
}
